import { createSlice } from "@reduxjs/toolkit";

const countSlice = createSlice({
  name: "count",
  initialState: {
    counter: 100,
  },
  reducers: {
    increment(state,{ payload }) {
      state.counter += payload 
    },
    decrement(state,{ payload }) {
      state.counter -= payload 
    },
  },
});

export const { increment, decrement } = countSlice.actions;
export default countSlice.reducer;